/**
* Copyright (c) By zengqh.
*
* This program is just for fun or demo, in the hope that it  
* will be useful, you can redistribute it and/or modify freely.
*
* Time: 2013/03/03
* File: VertexBuffer.h
* Blog: http://www.cnblogs.com/zengqh/
**/

#pragma once

#include <render_system/BaseRenderSystem/VertexBuffer.h>

namespace HY
{
class OGLVertexBuffer : public VertexBuffer
{
	friend class OGLRenderSystem;

public:
	virtual ~OGLVertexBuffer();

	virtual void bind();
	virtual void unbind();

	uint32 getHandle() const;

	virtual bool create(uint32 elems, uint32 usage);

	virtual void release();

	virtual void* lock(uint32 flags);

	virtual bool unlock();

	virtual bool addVertexAttribute(Attribute& attr);

protected:
	OGLVertexBuffer();

protected:
	uint32	handle_;
	uint32	usage_api_;
	int32	offset_[NumOfSemantics][MaxPipelineChannels];
	void*	lock_data_;
};
}